package com.lagou.boot;

import com.lagou.client.RPCConsumer;
import com.lagou.pojo.RpcRequest;
import com.lagou.service.IUserService;

/**
 * @author lvxinran
 * @date 2020/5/25
 * @discribe
 */
public class ConsumerBoot {
    public static RpcRequest request = new RpcRequest();

    public static void main(String[] args) throws InterruptedException {

        RPCConsumer consumer = new RPCConsumer();
        IUserService service = (IUserService) consumer.createProxy(IUserService.class, request);
        for(;;){
            if(service==null){
                continue;
            }
            Thread.sleep(1000);
            System.out.println(service.sayHello("are you ok?"));
        }
    }

}
